<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html lang="zh">
<head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <meta http-equiv="X-UA-Compatible" content="ie=edge"/>
    <title>体检结果打印</title>
    <style media="print">
        @page {
            size: auto;  /* auto is the initial value */
            margin: 5mm 0mm; /* this affects the margin in the printer settings */
        }
    </style>
    <style>
        * {
            font-size: 14px;
            font-family: 'SimHei', 'SimSun';
        }

        body {
            width: 100%;
            margin: 0;
            padding: 0;
        }

        .wrap {
            padding: 0px 50px 0px 50px;
            height: 50%;
        }

        .title {
            text-align: center;
            font-size: 1.8em;
            text-align: center;
            margin: 20px 0 10px 0;
        }

        /* h3 {
            font-size: 1.8em;
            text-align: center;
            margin: 30px 0 8px 0;
        } */

        table th, table td {
            vertical-align: middle;
        }

        .form-header, .form-bottom, .vacc-bottom {
            width: 100%;
            margin: 0 auto;
        }

        .form-bottom, .vacc-bottom {
            margin-bottom: 20px;
        }

        .form-bottom tr td {
            line-height: 25px;
        }

        .form-header td {
            width: 50%;
        }

        .vacc-info, .tran-tool {
            width: 100%;
            border-collapse: collapse;
            border-spacing: 0;
            text-align: center;
            margin-bottom: 1px;
        }

        .vacc-info th, .tran-tool th {
            font-weight: normal;
            /* font-size: 1.2em; */
            padding: 4px;
        }

        .tran-tool th {
            text-align: left;
        }

        .vacc-info td, .tran-tool td {
            font-size: 1.0em;
            padding: 4px;
        }

        .vacc-info-height td, .tran-tool td {
            height: 40px;
        }

        .tr-height td {
            height: 20px;
        }

        th span {
            bottom: -1px;
        }

        td span {
            margin-right: 4px;
            line-height: 26px;
            bottom: -2px;
        }
    </style>
</head>
<body>
<c:forEach items="${records}" var="record" begin="0" varStatus="status">
    <div class="wrap" style="height: 13.85cm;" >
        <p class="title">学 生 体 检 结 果 报 告 单</p>
        <table class="form-header">
            <tr>
                <td style="width: 50%;">学校：${record.schoolName}</td>
                <td style="width: 50%;">体检单位：${fns:getUser().office.name}</td>
            </tr>
        </table>
        <table border="1" class="form-header vacc-info vacc-info-height"
               style="border-bottom:0; border-bottom-color: white">
            <tr>
                <td style="width: 12%;">姓名：</td>
                <td style="width: 12%;">${record.student.stuName}</td>
                <td style="width: 12%;">性别：</td>
                <td style="width: 12%;">${fns:getDictLabel(record.student.gender,"sex",null)}</td>
                <td style="width: 12%;">出生日期：</td>
                <td style="width: 16%;"><fmt:formatDate value="${record.student.birthday}" pattern="yyyy-MM-dd"/></td>
                <td style="width: 12%;">民族：</td>
                <td style="width: 12%;">${fns:getDictLabel(record.student.nation,'nation' ,null )}</td>
            </tr>
        </table>
        <table border="1" class="vacc-info vacc-info-height">
            <tr>
                <td colspan="7">体 检 结 果 及 报 告</td>
            </tr>
            <tr>
                <td style="width: 17%;">身高（cm）</td>
                <td style="width: 13%;">${record.height}</td>
                <td style="width: 16%;">脾</td>
                <td style="width: 20%;" colspan="2"><c:choose>
                    <c:when test="${empty record.liver}">未触及肿大</c:when>
                    <c:otherwise>${record.liver}</c:otherwise>
                </c:choose></td>
                <td style="width: 16%;">脊柱</td>
                <td style="width: 18%;">
                    <c:choose>
                        <c:when test="${empty record.spine}">正常</c:when>
                        <c:otherwise>${record.spine}</c:otherwise>
                    </c:choose></td>
            </tr>
            <tr class="tr-height">
                <td rowspan="2">体重（kg）</td>
                <td rowspan="2">${record.weight}</td>
                <td rowspan="2">龋齿</td>
                <td>${record.leftUpperMouth}</td>
                <td>${record.rightUpperMouth}</td>
                <td rowspan="2">胸部</td>
                <td rowspan="2">未检</td>
            </tr>
            <tr class="tr-height">
                <td>${record.leftLowerMouth}</td>
                <td>${record.rightLowerMouth}</td>
            </tr>
            <tr>
                <td>肺活量（ml）</td>
                <td>${record.vitalCapacity}</td>
                <td>牙周</td>
                <td colspan="2">正常</td>
                <td>四肢</td>
                <td><c:choose>
                    <c:when test="${empty record.limb}">正常</c:when>
                    <c:otherwise>${record.limb}</c:otherwise>
                </c:choose></td>
            </tr>
            <tr>
                <td>血压（mmHg）</td>
                <td>${record.blood}</td>
                <td>脾</td>
                <td colspan="2">
                    <c:choose>
                        <c:when test="${empty record.liver}">正常</c:when>
                        <c:otherwise>${record.liver}</c:otherwise>
                    </c:choose>
                </td>
                <td>脊柱</td>
                <td><c:choose>
                    <c:when test="${empty record.spine}">正常</c:when>
                    <c:otherwise>${record.spine}</c:otherwise>
                </c:choose></td>
            </tr>
            <tr>
                <td>心</td>
                <td><c:choose>
                    <c:when test="${empty record.heart}">正常</c:when>
                    <c:otherwise>${record.heart}</c:otherwise>
                </c:choose></td>
                <td>视力</td>
                <td style="text-align: left">左 &nbsp;&nbsp;${ empty record.realLeftEye ? "5.0" : record.realLeftEye}</td>
                <td style="text-align: left">右 &nbsp;&nbsp;${ empty record.realRightEye ? "5.0" : record.realRightEye}</td>
                <td>淋巴结</td>
                <td><c:choose>
                    <c:when test="${empty record.lymphGland}">正常</c:when>
                    <c:otherwise>${record.lymphGland}</c:otherwise>
                </c:choose></td>
            </tr>
            <tr>
                <td>肺</td>
                <td><c:choose>
                    <c:when test="${empty record.luny}">正常</c:when>
                    <c:otherwise>${record.luny}</c:otherwise>
                </c:choose></td>
                <td>头部</td>
                <td colspan="2">正常</td>
                <td rowspan="2">其他</td>
                <td rowspan="2">正常</td>
            </tr>
            <tr>
                <td>肝</td>
                <td><c:choose>
                    <c:when test="${empty record.liver}">未触及肿大</c:when>
                    <c:otherwise>${record.liver}</c:otherwise>
                </c:choose></td>
                <td>颈部</td>
                <td colspan="2">正常</td>
            </tr>
        </table>
        <p style="font-size: 13px">注：家长同志,此报告单请妥善保管,它是您孩子学习期间生长发育健康状况档案！</p>
        <div style="text-align:right;width:100%;">
            日期： 2019<span>年</span> 03<span>月</span> 01<span>日</span>
        </div>
    </div>
</c:forEach>
</body>
<script>
    window.print();
    setTimeout("top.opener=null;window.close()", 1);
</script>
</html>